042742316924723221c8d5ed994413bc7ce7c98e,src/main/java/org/restheart/handlers/collection/GetCollectionHandler.java,GetCollectionHandler,handleRequest,#HttpServerExchange#RequestContext#,64

Before Change


        }

        try {
            CollectionRepresentationFactory crp = new CollectionRepresentationFactory();
            Representation rep = crp.getRepresentation(exchange, context, data, size);

            ResponseHelper.injectEtagHeader(exchange, context.getCollectionProps());
            exchange.setStatusCode(HttpStatus.SC_OK);

            // call the ResponseTranformerMetadataHandler if piped in
            if (getNext() != null) {
                BsonDocument responseContent = rep.asBsonDocument();
                context.setResponseContent(responseContent);

                getNext().handleRequest(exchange, context);
            }

            crp.sendRepresentation(exchange, context, rep);
            exchange.endExchange();
        } catch (IllegalQueryParamenterException ex) {
            ResponseHelper.endExchangeWithMessage(

After Change


        }

        try {
            context.setResponseContent(new CollectionRepresentationFactory()
                    .getRepresentation(exchange, context, data, size)
                    .asBsonDocument());

            context.setResponseContentType(Representation.HAL_JSON_MEDIA_TYPE);
            context.setResponseStatusCode(HttpStatus.SC_OK);

            ResponseHelper.injectEtagHeader(exchange, context.getCollectionProps());

            // call the ResponseTransformerMetadataHandler if piped in
            if (getNext() != null) {
                getNext().handleRequest(exchange, context);
            }
        } catch (IllegalQueryParamenterException ex) {
            ResponseHelper.endExchangeWithMessage(